# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-plumbum
pkgname=('python2-plumbum' 'python-plumbum')
_pkgname=plumbum
pkgver=1.9.0
pkgrel=1
pkgdesc='Shell combinators library.'
arch=('any')
url='https://pypi.org/project/plumbum/#files'
license=('GPL')
makedepends=('python2-setuptools' 'python-setuptools')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('afa0436e19ddea192ac7d33a3cdede6a86c801288d6678c9d9daa110ea049b14bc388fe4eb27e172d66595de282648b966043bed8f4c282350753afdf38e14de')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-plumbum() {
  depends=('python2' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-plumbum() {
  depends=('python' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

